x86: Fix cpu offline bug: add clflush inside dead loop
authorLiu, Jinsong <jinsong.liu@intel.com>
Fri, 11 Mar 2011 17:18:53 +0000 (17:18 +0000)
committerLiu, Jinsong <jinsong.liu@intel.com>
Fri, 11 Mar 2011 17:18:53 +0000 (17:18 +0000)
commitcbd8fa3005bd474514376940a672ed32f9da2d73
treeaee3723b27cfd2d12f3988d1a2508332bdaee69c
parent61799a138af63113b21594fe7e3a9de56f15815a
x86: Fix cpu offline bug: add clflush inside dead loop

At some platform (like Xen 7400), when hyperthreading, an offlined
thread may waked spuriously up by its brother, and returning around
the loop.  This patch explicitly clflush the cache line in a light
weight way to workaround potential issue.  Unlike wbinvd, clflush is
not serializing instruction, hence memory fence is necessary to make
sure all load/store operation visible before flush cache line.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
xen/arch/x86/acpi/cpu_idle.c